<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  <title>output test</title>
  <script>
    document.write(Date()); //向文档输出
    window.alert("hello");
    console.log("hello js");
    window.alert(15 + "a" + typeof (15 + "a"));
    document.getElementById("out").innerHTML = "innerHTML方式输出";
  </script>
</head>

<body>
  <p id="out"></p>
  <button onclick="document.write('在 HTML 文档完全加载后使用 document.write() 将删除所有已有的 HTML ')">
    点我试试
  </button>
</body>

</html>